<template>
        <div>
            <el-button @click="logout()" type="danger">退出登录</el-button>
        </div>
</template>

<script setup>
import {get} from "@/net";
import {ElMessage} from "element-plus";
import router from "@/router";
import {useStore} from "@/stores";


const store = useStore()
const logout =()=>{
    get("/api/auth/logout",(message)=>{
        ElMessage.success(message)
        store.auth.user = null
        router.push("/")
    })
}

</script>

<style scoped>
.index-con {
    height: 100%;
    width: 100%;
    box-sizing: border-box;
}

.aside {
    width: 64px !important;
    height: 100%;
    background-color: #334157;
    margin: 0px;
}
.asideshow {
    width: 240px !important;
    height: 100%;
    background-color: #334157;
    margin: 0px;
}
.index-header,
.index-main {
    padding: 0px;
    border-left: 2px solid #333;
}
</style>